{% extends "base_self.html" %}


{%block title%}管理小说{%endblock%}
{%block script%}{{super()}}{%endblock%}
{%block banner%}{%endblock%}
{% block main %}

<h2>{{novel}} - 添加新章节</h2>

<form class="" action="{{url_for('upnovelchapter',novel =novel,newchapter =newchapter)}}" method="post">
<div class="upnovelchapter">

  <table>
  <thead>
    <tr>
        <th>添加新章节</th>
        <td>第{{newchapter}}章</td>
        <td>标题：<input type="text" name="title" value=""></td>
        <td>内容提要：<input type="text" name="general" value=""></td>
    </tr>
  </thead>

  <tbody>
    <tr>
      <th>本章内容</th>
      <td colspan="3"> <textarea name="content" rows="8" cols="80"></textarea></td>
    </tr>
    <tr>
      <th>作者有话说</th>
      <td colspan="3"><textarea name="authorsay" rows="3" cols="80"></textarea></td>
    </tr>
    <tr>
      <td colspan="4"><button type="submit" name="button">确认发表</button></td>
    </tr>
  </tbody>

  </table>
</div>
</form>

{%for message in get_flashed_messages()%}
<div class="flash">
    {{message}}
</div>
{%endfor%}



<h2>{{novel}} - 章节列表</h2>
<form class="" action="{{url_for('chaptermanage',novel =novel)}}" method="post">

  <div class="upedlist">

    <table>
      <thead>
        <th>选择</th>
        <td>章节</td>
        <td>标题</td>
        <td>内容提要</td>
        <td>字数</td>
        <td>发表时间</td>
      </thead>
      <tbody>
          {%for key in noveldict%}
          {%if key != ""%}
          <tr>
            <td colspan="6" class ='juanbiao'>{{key}}<a href="{{url_for('updatejuan',juan = key,novel = novel)}}">[修改]</a>|<a href="{{url_for('deletejuan',juan =key,novel = novel,leastchapter = noveldict[key][0][0],biggestchapter=noveldict[key][-1][0])}}">[删除]</a></td>
          </tr>
          {%endif%}
          {%for item in noveldict[key]%}
            <tr>
              <th><input type="radio" name="chapter" value="{{item[0]}}"></th>
              <td>{{item[0]}}</td>
              <td>{{item[1]}}</td>
              <td>{{item[2]}}</td>
              <td>{{item[3]}}</td>
              <td>{{item[4]}}</td>
            </tr>
          {%endfor%}
          {%endfor%}
      </tbody>
      <tfoot>
        <tr>
          <td colspan="6" class="buttonjuan"><button type="submit" name="editchapter">编辑章节</button>|<button type="submit" name="addjuan">在此章节前增加卷标</button></td>
        </tr>
      </tfoot>
    </table>

  </div>
</form>




{%endblock%}
